/**
  ETFRoot project, Anyang Normal University && IMP-CAS
  \class ETFPreTaTracker
  \brief trackers for tracking upstream the reaction target
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-11-09
  \date 2021-11-09 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2021-11-09   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#include "ETFPreTaTracker.h"
#include "ETFDetectorManager.h"
#include "ETFVDC.h"
#include "ETFMath.h"
#include "ETFTrackTa.h"
#include "ETFTimer.h"

ClassImp(ETFPreTaTracker);

ETFPreTaTracker::ETFPreTaTracker(const char *name) : ETFTaTracker(name){
  if(!strcmp(name, "")) return;

  ETFDetectorManager *m = ETFDetectorManager::Instance();
  fDCs.push_back(dynamic_cast<ETFVDC *>(m->GetDetector("pdcU0")));
  fDCs.push_back(dynamic_cast<ETFVDC *>(m->GetDetector("pdcU1")));
  fTimer = dynamic_cast<ETFTimer *>(m->GetDetector("tstop0"));
} // end ctor

ETFPreTaTracker::~ETFPreTaTracker(){}

bool ETFPreTaTracker::SetDriftDistance(ETFVTrack *trk){
  return fDCs[0]->SetDriftDistance(trk);
} // end member function SetDriftDistance
